package com.elink.enginerring.util;

import java.util.Random;

/**
 * 生成6位随机验证码
 * @author Rick
 * 
 */
public class CheckCodeUtil {
	private static String nums = "0123456789";
	private static int length = 6;

	public static String getRandomCode() {
		Random random = new Random();
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < length; i++) {
			int j = random.nextInt(nums.length());
			sb.append(nums.charAt(j));
		}
		return sb.toString();
	}
}